{* MENU *}
<br/>
<!-- set dom.disable_window_status_change to false to enable status notification in ff -->
<script language="javascript">
	var timeouthandler = setTimeout(doTimeout,{$SESSION_TIMEOUT}*1000);
	var inter = setInterval(updateStatusBar,1000);
	var restTimeout = {$SESSION_TIMEOUT};
	
	function doTimeout() {ldelim}
		postMenu('logout');
	{rdelim}
	
	function restoreTimeout() {ldelim}
		clearTimeout(timeouthandler);
		restTimeout = {$SESSION_TIMEOUT};
		timeouthandler = setTimeout(doTimeout,{$SESSION_TIMEOUT}*1000);
	{rdelim}

	function updateStatusBar() {ldelim}
		restTimeout -= 1;
		window.status = html_entity_decode('{$lang.timeoutmessage} ' +restTimeout+' {$lang.seconds}');	
	{rdelim}
</script>

<div id="system_menu"> <!--class="system_menu"-->
	<div id="usermenu_menu">
		{include file="usermenu.tpl"}
	</div>
	<div id="glossary_menu">
		{include file="glossarymenu.tpl"}
	</div>
	<div id="application_menu">
		{foreach from=$applicationmenu item=menu}
			{$menu}
		{/foreach}
	</div>
	<div id="administration_menu">
		{include file="adminmenu.tpl"}
	</div>
</div>
{literal}
	<script language="javascript">
	var current_collapse = 1;
	var collapse_step = 260;
	var startTop = 5; /*ElementPosition.get($('system_menu')).top;*/
	//closeonload();
	
	function closeonload() {
		if (current_collapse == 1) {
			setTimeout(collapse,1000);
		}
	}
	
	function collapse() {
		if (current_collapse == 1) {
			new Effect.Move($('system_menu'),{x:(collapse_step*-1)});
			current_collapse = 0;
		} else {
			new Effect.Move($('system_menu'),{x:collapse_step});
			current_collapse = 1;
		}
		
	}
	
	function minimize(wn) {
		if ($(wn).style.display=="none") {
			$(wn).style.display="";
		} else {
			$(wn).style.display="none";
		}
	}
/*
	Event.observe(window, 'scroll', function() {
		var windowScroll = WindowUtilities.getWindowScroll($('system_menu').parent);
		var pageSize = WindowUtilities.getPageSize($('system_menu').parent);	
    	top = startTop + windowScroll.top;
  		$('system_menu').style.top = top+"px";
	});
	*/
	</script>
	
{/literal}